<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
  //ES6 允许按照一定模式从数组和对象中提取值，对变量进行赋值
  //这里被称为解构赋值

  //1.数组的解构
  const F4 = ['小沈阳','song','赵四'];
  let [xiao,liu,zhao] = F4;

  console.log(xiao);
  console.log(liu);
  console.log(zhao);

  //2.对象的解构
  const zhao2 = {
    name: '赵本山',
    age: '不详',
    xiaopin: function (){
      console.log("我可以演小品");
    }
  };

  let {name,age,xiaopin} = zhao2;
  console.log(name);
  console.log(age);
  console.log(xiaopin());
  xiaopin();


</script>

</body>
</html>